package cn.tj.mapper;

import cn.tj.entity.Register;
import cn.tj.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

@Mapper
public interface RegisterMapper {
    /**
     * 条件分页查询
     * @param account
     * @param minTime
     * @param maxTime
     * @return
     */
    List<Register> listByPage(String account, Date minTime, Date maxTime);

    /**
     * 通过审核，提交到用户表
     * @param user
     */
    @Insert("insert into user values " +
            "(null,#{nickname},#{account},#{password},#{root},null,null)")
    void check(User user);

    /**
     * 通过id删除信息
     * @param id
     */
    @Delete("delete from register " +
            "where id =#{id} ")
    void delete(Integer id);
}
